<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Calculatrice polonais inversé LO21:  Fichier source de /home/yuntux/UTC/GI02/LO21/projet/projet_propre/logmessage.h</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Calculatrice polonais inversé LO21
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Généré par Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Recherche');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="namespaces.html"><span>Espaces&#160;de&#160;nommage</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Recherche" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&#160;de&#160;fichier</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/yuntux/UTC/GI02/LO21/projet/projet_propre/logmessage.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="logmessage_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef LOGMESSAGE_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define LOGMESSAGE_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#include &lt;QtGui&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;exception&gt;</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="comment">/*********CODES ERREUR</span>
<a name="l00007"></a>00007 <span class="comment">0.Log simple pour avoir la trace</span>
<a name="l00008"></a>00008 <span class="comment">1,&quot;Division par zéro&quot;, important</span>
<a name="l00009"></a>00009 <span class="comment">2,&quot;La fonction X n&#39;est pas implémentée pour les Y.&quot;, moyen</span>
<a name="l00010"></a>00010 <span class="comment">3,&quot;Type de constante non prévu dans la fonction Constante* Reel::soustraction(Constante* c).&quot;, important</span>
<a name="l00011"></a>00011 <span class="comment">5,&quot;Nombre d&#39;opérandes  dans la pile insuffisant.&quot;, moyen</span>
<a name="l00012"></a>00012 <span class="comment">6,&quot;La chaine saisie est invalide&quot;, moyen</span>
<a name="l00013"></a>00013 <span class="comment">6,&quot;Action impossible dans ce mode&quot;, moyen</span>
<a name="l00014"></a>00014 <span class="comment">8,&quot;Saisie invalide&quot;, moyen</span>
<a name="l00015"></a>00015 <span class="comment">**********/</span>
<a name="l00016"></a>00016 
<a name="l00017"></a><a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71aafb733ab41298343829a774830914459">00017</a> <span class="keyword">enum</span> <a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71">niveau</a> {<a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71a8c5b883bce87e721f1fab27140beffa9">faible</a>, <a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71adf401a3bb36823971749977b65761888">moyen</a>, <a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71ad1ddbfba3ebb4db9f8a7c5af53b23777">important</a>, <a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71aafb733ab41298343829a774830914459">tracabilite</a>};
<a name="l00018"></a>00018 <span class="keyword">using namespace </span>std;
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="class_log_message.html">00020</a> <span class="keyword">class </span><a class="code" href="class_log_message.html">LogMessage</a>: <span class="keyword">public</span> exception
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022     <span class="keywordtype">int</span> m_numero;               <span class="comment">// Numéro de l&#39;erreur.</span>
<a name="l00023"></a>00023     <span class="keywordtype">string</span> m_phrase;            <span class="comment">// Description de l&#39;erreur.</span>
<a name="l00024"></a>00024     <span class="keyword">enum</span> <a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71">niveau</a> _level;               <span class="comment">// Niveau de l&#39;erreur.</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="keyword">public</span>:
<a name="l00027"></a><a class="code" href="class_log_message.html#aab5078209d6e258af2664286ab5b36f1">00027</a>     <a class="code" href="class_log_message.html#aab5078209d6e258af2664286ab5b36f1">LogMessage</a>(<span class="keywordtype">int</span> numero=0, <span class="keywordtype">string</span> <span class="keyword">const</span> &amp;phrase=<span class="stringliteral">&quot;&quot;</span>, <span class="keyword">enum</span> <a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71">niveau</a> lev=<a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71a8c5b883bce87e721f1fab27140beffa9">faible</a>) throw() : m_numero(numero),m_phrase(phrase),_level(lev){
<a name="l00028"></a>00028         <span class="keywordflow">if</span> (lev!=<a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71aafb733ab41298343829a774830914459">tracabilite</a>){
<a name="l00029"></a>00029             QMessageBox msgBox;
<a name="l00030"></a>00030             QString contenu(this-&gt;what());
<a name="l00031"></a>00031             contenu.toUtf8();
<a name="l00032"></a>00032             msgBox.setText(contenu);
<a name="l00033"></a>00033             msgBox.exec();
<a name="l00034"></a>00034         }
<a name="l00035"></a>00035     }
<a name="l00036"></a>00036 
<a name="l00037"></a><a class="code" href="class_log_message.html#a2c6798fafd31aa115d18bd348da69e25">00037</a>      <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_log_message.html#a2c6798fafd31aa115d18bd348da69e25">what</a>() <span class="keyword">const</span> throw()     { <span class="keywordflow">return</span> m_phrase.c_str(); }
<a name="l00038"></a>00038 
<a name="l00039"></a><a class="code" href="class_log_message.html#a433d0d6bdef1d3ec814fa08aec76e8ca">00039</a>      <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* getNiveau() <span class="keyword">const</span> throw()
<a name="l00040"></a>00040      {
<a name="l00041"></a>00041          <span class="keywordflow">if</span> (_level==<a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71a8c5b883bce87e721f1fab27140beffa9">faible</a>) <span class="keywordflow">return</span> <span class="stringliteral">&quot;Faible&quot;</span>;
<a name="l00042"></a>00042          <span class="keywordflow">if</span> (_level==<a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71adf401a3bb36823971749977b65761888">moyen</a>) <span class="keywordflow">return</span> <span class="stringliteral">&quot;Moyen&quot;</span>;
<a name="l00043"></a>00043          <span class="keywordflow">if</span> (_level==<a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71ad1ddbfba3ebb4db9f8a7c5af53b23777">important</a>) <span class="keywordflow">return</span> <span class="stringliteral">&quot;Important&quot;</span>;
<a name="l00044"></a>00044          <span class="keywordflow">if</span> (_level==<a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71aafb733ab41298343829a774830914459">tracabilite</a>) <span class="keywordflow">return</span> <span class="stringliteral">&quot;tracabilite&quot;</span>;
<a name="l00045"></a>00045          <span class="keywordflow">return</span> <span class="stringliteral">&quot;Niveau inconnu&quot;</span>;
<a name="l00046"></a>00046      }
<a name="l00047"></a>00047 
<a name="l00048"></a><a class="code" href="class_log_message.html#aa54fe583838d18c0f5bf6ce8d274b6f7">00048</a>     <span class="keyword">virtual</span> <a class="code" href="class_log_message.html#aa54fe583838d18c0f5bf6ce8d274b6f7">~LogMessage</a>() throw() {}
<a name="l00049"></a>00049 };
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="preprocessor">#endif // LOGMESSAGE_H</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tout</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Espaces de nommage</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Fichiers</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Fonctions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Énumérations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Valeurs énumérées</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Généré le Samedi Juin 16 2012 23:51:37 pour Calculatrice polonais inversé LO21 par &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
